-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: use starknet-sierra-compile executable in util #16
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #16 +/- ##
===========================================
+ Coverage 38.46% 59.18% +20.72%
===========================================
Files 2 3 +1
Lines 26 49 +23
Branches 26 49 +23
===========================================
+ Hits 10 29 +19
- Misses 14 16 +2
- Partials 2 4 +2 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 6 files reviewed, 1 unresolved discussion (waiting on @ArniStarkware, @dafnamatsry, and @elintul)
crates/gateway/src/compiler/starknet-sierra-compile
line 0 at r1 (raw file):
This might have some issues
a) Will this work in non-debian systems?
b) This isn't linked to a specific version of the compiler, otherwise we/users won't know what version of compiler it's using. but that I guess can be fixed by declaring it the file name.
c) lib size will increase by 9 MB, is that ok?
d) Serde has recently tried to pre-compile some of their stuff in crates.io, and the community didn't like it, so they reverted it.
I recommend checking that out and seeing what were the objections.
(For us it broke the Pyo3 build, for example).
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 6 files reviewed, 5 unresolved discussions (waiting on @ArniStarkware and @elintul)
crates/gateway/src/compiler/compile.rs
line 11 at r1 (raw file):
// TODO(Arni, 1/05/2024): Add the configurable parameters to the function. pub fn compile_sierra_to_casm(sierra_path: &str) -> Vec<u8> { let add_pythonic_hints = true; // TODO: make this configurable?
Is it configurable now? If not, then let not make it configurable here as well, and you can remove this boolean.
crates/gateway/src/compiler/compile.rs
line 14 at r1 (raw file):
let compiler_path = STARKNET_SIERRA_COMPILE_EXE; let mut command = Command::new(compiler_path);
We should be able to limit the resources usage of the compiler (like memory usage).
crates/gateway/src/compiler/compile.rs
line 15 at r1 (raw file):
let mut command = Command::new(compiler_path); command.arg(sierra_path);
In Python, I see that we run the compiler with additional args like --max-bytecode-size
, --allowed-libfuncs-list-name
, --allowed-libfuncs-list-file
.
crates/gateway/src/compiler/compile.rs
line 29 at r1 (raw file):
let stderr_output = String::from_utf8(compile_output.stderr).unwrap(); // TODO: handle error if !compile_output.status.success() { panic!("Failed to compile Sierra code: {}", stderr_output);
Please return an error.
This change is